package com.sec.rule;

import com.netflix.loadbalancer.AvailabilityFilteringRule;
import com.netflix.loadbalancer.IRule;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class myrule {
    /**
     * @return
     * AvailabilityFilteringRule 过滤掉故障的服务，对剩下的进行轮询
     * RandomRule  随机
     * RetryRule  会按照轮询获取服务，对故障的服务在指定时间里重试
     */
    @Bean
    public IRule myIRule()
    {
        return new AvailabilityFilteringRule();
    }
//    @Bean
//    public IRule myIRule()
//    {
//        return new zkRule();
//    }
}
